import { RiskRow } from "./interface";

export const getNotifierChoicesDisplay = (record: RiskRow) => {
  const base: string[] = [];
  if ((record.notifierChoices || []).some((r) => r == 1)) {
    base.push("创建人");
  }
  if ((record.notifierChoices || []).some((r) => r == 2)) {
    (record.users || []).forEach((element) => {
      base.push(element.userName);
    });
  }
  if ((record.notifierChoices || []).some((r) => r == 3)) {
    base.push(record.notifierFieldName);
  }

  return base.length ? base.join(",") : "--";
};
